function [data2] = loadPeriodicData(config, tt_subset_idxes)
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	% This function loads the covariates data from a periodic dataset file.
	% It is to be used in constructing runData for continuous-time models (not discrete-time).
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%% Inputs:
	% config:						
	%	.datasetFile
	%	.timeAggregationsFolder
	%	.timeAggLevel
	%	.geoAggLevel
	%	.surfaceVar_Zname
	%	.laggedAdoptionEffects
	% tt_subset_idxes:				vector of integers
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%%%%% Outputs:
	% data2:			object
	%	.periodicData:		object
	%	. other fields
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	
	[data, surfaces, surfaceName, population, geoAggLevelNames, geoAggLevelLabels, ...
	        timeAggLevelNames, timeAggLevelLabels] = getRealData0(config);
	
	goodX_idxes = find(~ismember(data.Xnames, {'LaggedUsers', 'LaggedCars', 'LaggedConsumers', 'LaggedProviders'}));
	data.X = data.X(:,:,goodX_idxes);
	data.Xnames = data.Xnames(goodX_idxes);
	clear goodX_idxes;
	
	%%% Subset time
	data.X = data.X(tt_subset_idxes,:,:); % T x K x NumX
	data.A = data.A(tt_subset_idxes,:); % T x NumA
	data.timeLabels = data.timeLabels(tt_subset_idxes); % cell(1,T) of strings
	
	%% Get periodLabels and geoLabels
	periodLabels = data.timeLabels;
	geoLabels    = data.geoLabels;
	
	%% Get incomingCommuters and touristBeds (useful in counterfactuals)
	incomingCommuters = data.Z(:,find(strcmp(data.Znames, 'NumCommutersToLocation'))); % K x 1
	touristBeds       = data.Z(:,find(strcmp(data.Znames, 'NumTouristBeds'))); % K x 1
	
	
	% Store everything into object periodicData
	periodicData.population        = population;        % K x 1
	periodicData.surfaces          = surfaces;          % K x 1
	periodicData.incomingCommuters = incomingCommuters; % K x 1
	periodicData.touristBeds       = touristBeds;       % K x 1
	periodicData.periodLabels = periodLabels;
	periodicData.geoLabels    = geoLabels;
	
	periodicData.A     = data.A;
	periodicData.Z     = data.Z;
	periodicData.X     = data.X;
	periodicData.Anames     = data.Anames;
	periodicData.Znames     = data.Znames;
	periodicData.Xnames     = data.Xnames;
	
	periodicData.surfaceName = config.surfaceVar_Zname;
	periodicData.geoAggLevelNames    = geoAggLevelNames;
	periodicData.geoAggLevelLabels   = geoAggLevelLabels;
	periodicData.timeAggLevelNames   = timeAggLevelNames;
	periodicData.timeAggLevelLabels = timeAggLevelLabels;
	
	
	%%%%%% Store everything into data2
	data2.periodicData = periodicData;
	
	data2.geoLabels    = geoLabels;
	data2.periodLabels  = periodLabels;
	
	data2.population   = population;
	data2.surfaces     = surfaces;
	data2.incomingCommuters = incomingCommuters;
	data2.touristBeds       = touristBeds;
	data2.surfaceName       = surfaceName;
end
